#ifndef ARCH_H_
#define ARCH_H_

/*
	Copyright (C) 2014 Salil Bhagurkar

	This file is part of illusion

	illusion is free software: you can redistribute it and/or modify
	it under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	illusion is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with illusion.  If not, see <http://www.gnu.org/licenses/>.
*/

//
// File Visibility: KERNEL
// Subsystem: ARCH
// File Description: This is the main set of stuff exported by the platform
// to the kernel. When writing for other architectures, all of this must be
// exported. The platform must also register at least 1 console driver.
//

#include <kernel/types.h>

struct bioscall_regs {
	u32 eax,ebx,ecx,edx,esi,edi;
	u16 f; /*f is the int no when calling and returns the flags after returning*/
}__attribute__((packed));

void bios_call(struct bioscall_regs *regs);

void set_timer_handler(void (*handler)(), int frequency);
void reset_timer_handler();

int interrupts_enabled();
void disable_interrupts();
void enable_interrupts();

void print_state(void *state);

/*
 * Use before switching to a process.
 * This will tell the processor what stack to use when returning to kernel mode
 * from the process's user mode.
 */
void set_current_kernel_stack(u32 esp);

#endif /* ARCH_H_ */
